<template>
  <div class="user-bar">
    <div class="user-logo">
      <img src="@/assets/images/user.png" alt width="36px" height="36px"/>
    </div>
    <div class="content">
      <div class="content-box">
        <div class="bubble">
          {{ text }}
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
defineProps({
  text: {
    type: String,
    default: ''
  }
})
</script>

<style scoped>
.user-bar {
  align-items: flex-end;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  left: 3px;
  margin: 16px auto;
  max-width: 896px;
  min-width: 320px;
  position: relative;
  text-align: left;
  width: calc(100% - 180px);
}
.user-logo {
  align-items: center;
  background: #3ca0be no-repeat;
  background-size: cover;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 36px;
  justify-content: center;
  right: -48px;
  overflow: hidden;
  position: absolute;
  top: 8px;
  width: 36px;
  border: 2px solid #2c3e50;
}
.content {
  background: none;
  display: flex;
  flex-wrap: wrap;
  font-size: 16px;
  justify-content: flex-end;
  position: relative;
  width: 100%;
  word-break: break-all;
}
.content-box {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  width: 100%;
}
.bubble {
  word-wrap: break-word;
  background-color: #e0dfff;
  border: 1px solid transparent;
  border-radius: 12px;
  line-height: 24px;
  max-width: 100%;
  padding: 12px 16px;
  white-space: pre-wrap;
  will-change: opacity, transform;
}
</style>